﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RadarGlobalPro.Class
{
    public class User
    {
        public int UserID { set; get; }
        public string Username { set; get; }
        public string Password { set; get; }
        public string Fullname { set; get; }
        public string Email { set; get; }
        public int Permission { set; get; }
        public int Status { set; get; }
        public int TagType { set; get; }
        public static List<User> DeserializeObject(List<List<string>> data,int TagType=0)
        {
            List<User> result = new List<User>();

            foreach (List<string> items in data)
            {
                if (items.Count >= 5)
                {
                    User item = new User()
                    {
                        UserID = int.Parse(items[0]),
                        Username = items[1],
                        Fullname = items[2],
                        Email = items[3],
                        Status = int.Parse(items[4]),
                        Password="",
                        TagType = TagType
                    };
                    result.Add(item);
                }
            }
            return result;
        }
    }
}
